package com.company;

import java.util.Scanner;

public class Main{

    public String isWin;

    public static void main(String[] args) {
        Main main = new Main();
        NGuessNumber nGuessNumber = new NGuessNumber();
        Scanner s = new Scanner(System.in);
        System.out.println("请按0开始游戏");
        int x = s.nextInt();
        while (x == 0) {
            main.isWin = String.valueOf(nGuessNumber.compareGuessAnswer());
            if (main.isWin.equals("true")){
                System.out.println("恭喜你获胜啦！");
            }else if(main.isWin.equals("false")){
                System.out.println("很遗憾你失败啦！再接再厉");
            }
            System.out.println("是否结束游戏，结束请按1,重新开始请按0");
            int y = s.nextInt();
            if (y==1){
                break;
            }
        }
    }
}


